package com.ds.infrastructure.hyperspace.console.model.response.stage;

import com.ds.infrastructure.hyperspace.console.entity.table.TbStage;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Map;

/**
 * @author: yaozhendong
 * @create: 2019-09-20 09:38
 **/
@Data
@NoArgsConstructor
public class ListStageVO {
    private Long id;

    private String environmentName;

    private String stageName;

    private String description;

    private Date gmtModified;

    private Date gmtCreate;

    public static ListStageVO toVO(TbStage entity, Map<Long, String> tbProxyMap) {
        ListStageVO listStageVO = new ListStageVO();
        listStageVO.setId(entity.getId());
        listStageVO.setEnvironmentName(tbProxyMap.get(entity.getEnvironmentId()));
        listStageVO.setStageName(entity.getStageName());
        listStageVO.setDescription(entity.getDescription());
        listStageVO.setGmtModified(entity.getGmtModified());
        listStageVO.setGmtCreate(entity.getGmtCreate());
        return listStageVO;
    }
}
